<template>
	<view>
		<block v-if="mysubscribe.length">
			<view class="" v-for="(item,i) in mysubscribe" :key="i">
				<view class="font-24 m-24">{{item.subscribe_time}}</view>
				<view class="p-l-24 p-r-24">
					<shopItem type="yuYue" :item="item"></shopItem>
				</view>
			</view>
		</block>
		<block v-else>
			<noneList></noneList>
		</block>
		<view class="bottom-mar"></view>
		
		<uv-load-more :status="loadStatus" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loadShow: true,
				loadStatus: 'loadmore',
				pageNum: 1,
				mysubscribe: []
			};
		},
		onShow() {
			this.mysubscribe = []
			this.loadShow = true,
			this.loadStatus = 'loadmore',
			this.pageNum = 1
			this.getYuYue()
		},
		methods: {
			getYuYue() {
				if (this.loadShow) {
					this.loadStatus = 'loading'
					this.loadShow = false
				this.$api.sendRequest({
					url: '/api/shop/mysubscribe',
					data: {
						page: this.pageNum
					},
					success: res => {
						this.mysubscribe.push(...res.data.data)
						if (res.data.data.length < 10) {
							this.loadShow = false
							this.loadStatus = 'nomore'
							return
						}
						this.pageNum++
						this.loadShow = true
						this.$forceUpdate()
					}

				})
			}
		}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f5f6f7;
	}
</style>
